-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EN-207 Add asset folder codenames #274
EN-207 Add asset folder codenames #274
Conversation
{ | ||
return itm; | ||
} | ||
else if (itm.Folders != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would lose this unnecessary else
statement and use null coalescing to make it a bit more compact. also, wouldn't folder
be more fitting variable name than itm
in the foreach? seems slightly more readable, but that's just a nitpick
foreach (var folder in folders)
{
if (folder.Id == folderId)
{
return folder;
}
var nestedFolder = folder.Folders?.GetFolderHierarchyById(folderId);
if (nestedFolder != null) //This is required so you don't stop processing if the root contains many folders (let the above foreach loop continue)
{
return nestedFolder;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, looks good, fixed.
{ | ||
return folder; | ||
} | ||
else if (folder.Folders != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
337c067
to
c15bccd
Compare
Motivation
Adding support for asset folder codenames, so assets can be inserted into specific folder, referenced by its codename.
Checklist
How to test
Try getting / adding asset folders with codenames, adding asset to a folder referenced by codename.